<?php
include 'base.php';
$sql = "SELECT * FROM `goods` GROUP BY `cat_one_id`";

$res = $conn->query($sql);

$arr = array();
for ($i = 0; $i < 7; $i++) {
  $row = mysqli_fetch_assoc($res);
  array_push($arr, $row);
}

echo json_encode($arr);